<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <html> 
<head> 
	
	<meta name="viewport" content="width=device-width, initial-scale=1"> 
	<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
	<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
	<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Forum</title>
</head>
<html>
    <%@ page import="java.sql.*" %>
    <%@ page import="java.io.*" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
 String driver="com.mysql.jdbc.Driver";
Class.forName(driver).newInstance();
Connection con=null;

 Statement st=null;
 ResultSet result=null;

 con= DriverManager.getConnection("jdbc:mysql://localhost:3306/ghine","root","25955103");
 st=con.createStatement();
 	
 result=st.executeQuery("Select * from forum_question");
 String name="";
 
  

%>
<html>

<title>Forum</title>

<body>

 <div data-role=content>
<div class="ui-grid-d">
	<div class="ui-block-a">id</div>
	<div class="ui-block-b">topic</div>
	<div class="ui-block-c">views</div>
	<div class="ui-block-d">replies</div>
	<div class="ui-block-e">date/time</div>
</div><!-- /grid-b -->

<br>
<%
while(result.next())
{

%>

<div class="ui-grid-d">
	<div class="ui-block-a"><%out.print(result.getInt("id")); %> </div>
	<div class="ui-block-b"><a href="view_topic.jsp?id=<% out.println(result.getInt("id")); %>"><%out.print(result.getString("topic"));%></a></div>
	<div class="ui-block-c"><%out.print(result.getString("view"));%></div>
	<div class="ui-block-d"><%out.print(result.getString("reply"));%></div>
	<div class="ui-block-e"><%out.print(result.getString("datetime"));%></div>
</div><!-- /grid-b -->



<%
out.print("<br>");
}
con.close();
%>


</body>
</html>